#ifndef CONTROLLER_H
#define CONTROLLER_H

#include <QObject>
#include <QHotkey>
#include <QSystemTrayIcon>
#include <QIcon>
#include <QAction>
#include <QMenu>
#include <QStringListModel>
#include "launchbar.h"
#include "executor.h"

class Controller : public QObject
{
    Q_OBJECT
private:
    QHotkey *hotkey;
    QSystemTrayIcon *trayicon;

    QStringListModel model;

    LaunchBar *launchbar;
    Executor *executor;

    QMenu *menu;
    QAction *showHideAction;
    QAction *reloadAction;
    QAction *quitAction;
    QAction *caseSensitiveAction;

    void setupTrayicon();
    void setupConnections();
    void trayActivated();

public:
    Controller(QObject *parent = nullptr);
    ~Controller();
public slots:
    void executeInnerAction(const QString &action);
    void showLinksDir();
    void reload();
    void quit();
};

#endif // CONTROLLER_H
